<template lang='pug'>
DataTablePage.table(
  ref="tablePage"
  :resource="resource"
  title="快捷回复"
  label="快捷回复"
  labelName="id"
  :toolbar="toolbar"
  :operation="operation"
  :operationWidth="120"
  :createList="createList"
  :updateList="updateList"
  :tableFullList="tableFullList"
  :tableInitList="tableInitList"
  :filterFullList="filterFullList"
  :filterInitList="filterInitList"
  :columns="columns")
</template>

<script>
/**
 * @name 快捷回复列表
 * @author linmn
 */
import DataTablePage from '@/containers/DataTablePage'
import { operationUpdate, operationDelete } from '@/containers/DataTablePage/operation'
import {toolbarCreate} from '@/containers/DataTablePage/toolbar'
import {initColumns} from './columns'
export default {
  name: 'QuickReply',
  components: {
    DataTablePage
  },
  data () {
    return {
      // 快捷回复
      resource: '/workflow/quickReply',
      tableInitList: ['serial', 'flowDefineId', 'text', 'userName', 'createTime', 'updateTime'],
      tableFullList: ['flowDefineId', 'text', 'userName', 'createTime', 'updateTime'],
      createList: ['flowDefineId', 'text'],
      updateList: ['flowDefineId', 'text'],
      filterInitList: [],
      filterFullList: [],
      orderByInit: [{
        name: 'updateTime',
        sort: 'desc'
      }],
      toolbar: [toolbarCreate],
      columns: {
        /* 快捷回复 */
        ...initColumns,
        text: {
          label: '快捷回复内容',
          form: {
            type: 'textarea',
            rules: [{
              type: 'required',
              message: '请填写快捷回复内容'
            }]
          }
        },
        userId: {
          label: '用户'
        },
        userName: {
          label: '用户名',
          form: {
            type: 'input'
          }
        }
      },
      // 快捷回复操作
      operation: [operationUpdate, operationDelete]
    }
  }
}
</script>

<style lang='sass' scoped>
.table
  margin-top: 0 !important
</style>
